<template>
<div>
    <div class="recom-item" @click="clickitem" v-for="(item,index) in hotList" :key="index">
        <img :src="item.blogImage" alt="">
        <div class="item-text">
          <p>{{item.blogTitle}}</p>
          <span>时间：{{item.createTime}}</span>
          <span>观看数：{{item.blogViews}}</span>
        </div>
    </div>
</div>
</template>

<script>
export default{
  name: 'articleitem',
  props: {
      hotList: {
          type: Array
      }
  },
  methods: {
    clickitem() {
      this.$emit('clickrecitem')
    }
  }
}
</script>

<style scoped>
.recom-item{
  display: flex;
  padding: 12px 16px 12px 16px;
  width: 290px;
  background-color: #f7f7f7;
  border-bottom: 3px solid #f1f1f1;
}
.recom-item:hover{
  cursor: pointer;
  background-color: rgba(201, 255, 214, 0.3);
  color: #65c265;
}
.recom-item img{
  width: 100px;
  height: 68px;
  border-radius: 5px;
}
.item-text{
  width: 65%;
  padding-left: 10px;
}
.item-text p{
  width: 100%;
  max-height: 40px;
  overflow: hidden;
  white-space: pre-wrap;
}
.item-text span{
  font-size: 12px;
  color: #a1a1a1;
  padding-right: 10px;
  margin-top:10px ;
  display: block;
}
</style>
